<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page pageEncoding="UTF-8" %>
    <!DOCTYPE html>
    <html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>模板</title>
    <jsp:include page="/layout/css.jsp"/>


</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-10">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>业主缴费</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="form_basic.html#">选项1</a>
                                </li>
                                <li><a href="form_basic.html#">选项2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" action="${pageContext.request.contextPath}/PaymentServlet/addupd">
                            <div class="form-group" style="display: none">
                                <label class="col-sm-3 control-label">时间：</label>
                                <div class="col-sm-8">
                                    <input name="paymentTime"  class="form-control" aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">住户编号：</label>
                                <div class="col-sm-8">
                                    <input  name="ownerId" value="${owner.ownerId}"  class="form-control" required="" aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">类型：</label>
                                <div class="col-sm-8">
                                <select name="paymentType" class="form-control">
                                    <option value="电费">电费</option>
                                    <option value="水费">水费</option>
                                    <option value="宽带">宽带</option>
                                    <option value="物业费">物业费</option>
                                    <option value="燃气费">燃气费</option>
                                    <option value="有线电视">有线电视</option>
                                </select>
                            </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">缴费单位：</label>
                                <div class="col-sm-8">
                                    <input name="paymentUnit"  type="text" class="form-control"  aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">数量：</label>
                                <div class="col-sm-8">
                                    <input name="paymentNum"  type="text" class="form-control"  aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">金额：</label>
                                <div class="col-sm-8">
                                    <input name="paymentPrice" class="form-control" required="" aria-required="true">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                    <button class="btn btn-primary" type="submit">提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <jsp:include page="/layout/script.jsp"/>

</body>
<script>

    var date = new Date();
    var h,m,s;
    if(date.getHours()>=0&&date.getHours()<10){
        h = "0" + date.getHours();
        if(date.getMinutes()>=0&&date.getMinutes()<10) {
            m = "0" + date.getMinutes();
            if(date.getSeconds()>=0&&date.getSeconds()<10){
                s = "0" + date.getSeconds();
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+h+':'+m+":"+s;
                $('[name=paymentTime]').val(date1);
            }else{
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+h+':'+m+":"+date.getSeconds();
                $('[name=paymentTime]').val(date1);
            }
        }else {
            if(date.getSeconds()>=0&&date.getSeconds()<10){
                s = "0" + date.getSeconds();
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+h+':'+date.getMinutes()+":"+s;
                $('[name=paymentTime]').val(date1);
            }else{
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+h+':'+date.getMinutes()+":"+date.getSeconds();
                $('[name=paymentTime]').val(date1);
            }
        }
    }else{
        if(date.getMinutes()>=0&&date.getMinutes()<10) {
            m = "0" + date.getMinutes();
            if(date.getSeconds()>=0&&date.getSeconds()<10){
                s = "0" + date.getSeconds();
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+date.getHours()+':'+m+":"+s;
                $('[name=paymentTime]').val(date1);
            }else{
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+date.getHours()+':'+m+":"+date.getSeconds();
                $('[name=paymentTime]').val(date1);
            }
        }else {
            if(date.getSeconds()>=0&&date.getSeconds()<10){
                s = "0" + date.getSeconds();
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+":"+s;
                $('[name=paymentTime]').val(date1);
            }else{
                date1 = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+":"+date.getSeconds();
                $('[name=paymentTime]').val(date1);
            }
        }
    }

    <c:if test="${msg!=null}">
        layer.ready(function(){
            layer.msg('${msg}');
        });
    </c:if>

</script>
</html>
